package com.robot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.robot.model.Maintenance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 维保记录Mapper接口
 */
@Mapper
public interface MaintenanceMapper extends BaseMapper<Maintenance> {
    
    /**
     * 根据公司、年份和月份查询维保记录
     */
    @Select("SELECT * FROM maintenance WHERE company = #{company} AND year = #{year} AND month = #{month}")
    List<Maintenance> findByCompanyAndYearAndMonth(@Param("company") String company, 
                                               @Param("year") Integer year, 
                                               @Param("month") Integer month);
    
    /**
     * 根据公司和年份查询维保记录
     */
    @Select("SELECT * FROM maintenance WHERE company = #{company} AND year = #{year}")
    List<Maintenance> findByCompanyAndYear(@Param("company") String company, 
                                       @Param("year") Integer year);
} 